"Sections":[
{
"ProfileHeader":{
"ActivityItems":[
{
"ActivityType":"Phone",
"ActivityValue":"{PhoneNumber}"
},
{
"ActivityType":"VideoCall",
"ActivityValue":"{PhoneNumber}"
},
{
"ActivityType":"Email",
"ActivityValue":"{EmailAddress}"
},
{
"ActivityType":"Detail",
"ActivityValue":"This is an alert"
}
],
"Description":"{CustomerId}",
"DetailImage":"/DemoProj/Images/contact-cell.png",
"DetailImageIsCircular":true,
"Headline":"{{#Property:FirstName}} {{#Property:LastName}}",
"Styles":{
"BackgroundColor":"ProfileHeaderBackgroundColor",
"Description":"ProfileHeaderDescription",
"Headline":"ProfileHeaderHeadline",
"Subheadline":"ProfileHeaderSubheadline"
},
"Subheadline":"{City}"
},
"Visible":true,
"_Name":"Control0",
"_Type":"Section.Type.ProfileHeader"
}
],
"_Name":"SectionedTable",
"_Type":"Control.Type.SectionedTable"
}
Control | Attribute in control | Documentation Reference |
ObjectHeader | DetailImage, StatusImage, SubstatusImage | Reference |
ProfileHeader | DetailImage | Reference |
ObjectCell | DetailImage, Icons, StatusImage, SubstatusImage | Reference |
ContactCell | DetailImage | Reference |
GridRowItem | Image Row Item | |
ImageCell | Image | Reference |
"DetailImage": "https://icon-library.net/images/0234605a9c_92936.png",
{
"ClearHistory":true,
"PageToOpen":"/DemoProj/Pages/Customers/Customers_List.page",
"_Type":"Action.Type.Navigation"
}
#Application/#ClientData/#Property:Session/#Property:SessionID
<EntityType Name="Image" HasStream="true">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Int64" Nullable="false"/>
<Property Name="label" Type="Edm.String" Nullable="true"/>
<Property Name="created" Type="Edm.Date" Nullable="true"/>
<Property Name="updated" Type="Edm.Date" Nullable="true"/>
<NavigationProperty Name="artist" Type="Self.Artist"/>
</EntityType>
<EntityType Name="Artist">
<Key>
<PropertyRef Name="id"/>
</Key>
<Property Name="id" Type="Edm.Int64" Nullable="false"/>
<Property Name="firstName" Type="Edm.String" Nullable="false"/>
<Property Name="lastName" Type="Edm.String" Nullable="false"/>
<Property Name="dateOfBirth" Type="Edm.Date" Nullable="true"/>
<NavigationProperty Name="images" Type="Collection(Self.Image)"/>
</EntityType>
{
"_Type": "Action.Type.ODataService.CreateRelatedMedia",
"Target" : {
"EntitySet" : "Images",
"Service" : "/AssetWorkManager/Services/Amw.service"
},
"Properties" : {
"ClassName": "#CurrentPage/#Control:ClassName/#Value",
"ClassType": "#CurrentPage/#Control:ClassType/#Value",
"ObjectKey": "#CurrentPage/#Control:ObjectKey/#Value",
"FileName": "#CurrentPage/#Control:FileName/#Value"
},
"ParentLink": {
"Property": "images",
"Target": {
"EntitySet": "Artists",
"ReadLink": "{@odata.readLink}"
}
},
"Headers" : {
"slug" : {
"ClassName": "#CurrentPage/#Control:ClassName/#Value",
"ClassType": "#CurrentPage/#Control:ClassType/#Value",
"ObjectKey": "#CurrentPage/#Control:ObjectKey/#Value",
"FileName": "#CurrentPage/#Control:FileName/#Value"
}
},
"IsOnlineRequest": true,
"Media":"#CurrentPage/#Control:Attachment/#Value",
"OnSuccess" : "/AssetWorkManager/Actions/ODataCreateEntitySuccessMessage.action",
"OnFailure": "/AssetWorkManager/Actions/ODataCreateEntityFailureMessage.action"
}
{
"_Type": "Action.Type.ODataService.CreateRelatedEntity",
"Target": {
"EntitySet": "SalesOrderHeaders",
"Service": "/MDKDevApp/Services/OnlineSampleService.service"
},
"Properties": {
"SalesOrderId": "/MDKDevApp/Rules/GetSalesOrderId.js"
},
"ParentLink": {
"Property": "SalesOrders",
"Target": {
"EntitySet": "Customers",
"ReadLink": "{@odata.readLink}"
}
},
"ActionResult": {
"_Name": "OData"
},
"OnSuccess": "/MDKDevApp/Actions/Messages/Success.action",
"OnFailure": "/MDKDevApp/Actions/Messages/Failure.action"
}
You can now format things like date, time, currency etc that returns the appropriate value based on the runtime platform (iOS or Android).
$(PLT, <iOS>, <Android>)
If the platform is iOS the first parameter is returned.
If the platform is Android the second parameter is returned
If the parameter is blank then the property where the function is evaluated should behave as if the property is not specified.
It supports the following value types:
sendMobileServiceRequest(path: string, params?: any): Promise<any>;
/**
* Describe this function...
* @param {IClientAPI} context
*/
export default function DoSomePostRequest(context) {
debugger;
let userid = context.evaluateTargetPath('#Control:User/#Value');
let appId = context.evaluateTargetPath('#Application/#ClientData/#Property:MobileServiceAppId');
let uri = '/my/rest/api/v1/doSomething';
let body = {
"FirstName": "John",
"LastName": "Doe",
"Address": {
"Street": "Some Street",
"City": "AB",
"Country": "CD"
},
"UserId": userid
};
let header = {
"x-smp-appid": appId,
"Content-Type": "application/json"
};
let params = {
'method': 'POST',
'header': header,
'body': JSON.stringify(body)
};
return context.sendMobileServiceRequest(uri, params).then((result)=>{
console.log(Result: ${result});
console.log(Result Content: ${result.content});
console.log(Result statusCode: ${result.statusCode});
if (result && result.statusCode === 201 && result.content) {
//DO WHAT YOU NEED WITH THE result.content here e.g.
let data = JSON.parse({ "result": ${result.content.toString()}});
context.getPageProxy().setActionBinding(data);
return context.executeAction("/MyApp/Actions/ShowResult.action");
} else if (result) {
console.log(Failed Result: ${result.statusCode});
}
else {
console.log(Failed Result: ${result.content});
}
});
}
{
"OnSuccess":"/DemoSampleApp/Actions/UpdateStatusSuccess.action",
"Target":{
"Function":{
"Name":"UpdateSalesOrderStatus",
"Parameters":{
"id":"{SalesOrderId}",
"newStatus":"R"
}
},
"Service":"/DemoSampleApp/Services/SampleServiceV2.service"
},
"_Type":"Action.Type.ODataService.CallFunction"
}
// Display in date format
formatDate(date: Date, customLocale?: string, customTimeZone?: string, customOptions?: any): string;
// Display in datetime format
formatDatetime(date: Date, customLocale?: string, customTimeZone?: string, customOptions?: any): string;
// Display in time format
formatTime(date: Date, customLocale?: string, customTimeZone?: string, customOptions?: any): string;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
26 | |
21 | |
19 | |
13 | |
10 | |
9 | |
8 | |
8 | |
7 | |
7 |