Hi Appain

i have a problem when add the new record using the record action , when i want to add the new record the record does not added to data base and the grid please help 

{
  a!sectionLayout(
    label: "",
    contents: {
      a!billboardLayout(
        backgroundMedia: a!webImage(
          source: "https://static.pointcheckout.com/16cd7c7425e54498/original"
        ),
        backgroundColor: "#f0f0f0",
        height: "MEDIUM_PLUS",
        marginBelow: "NONE"
      ),
      a!gridField(
        label: "",
        labelPosition: "ABOVE",
        data: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit',
        columns: {
          a!gridColumn(
            label: "Deposit Id",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{c27cd643-e617-46e3-a4dd-c16df94bbed2}idDeposit',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{c27cd643-e617-46e3-a4dd-c16df94bbed2}idDeposit'],
            align: "CENTER",
           
          ),
          a!gridColumn(
            label: "Account Id",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{fd8c420d-ca89-4ef3-8269-f871e713b3e4}idAccount',
            value: a!linkField(
              links: {
                a!recordLink(
                  label: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{fd8c420d-ca89-4ef3-8269-f871e713b3e4}idAccount'],
                  recordType: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit',
                  identifier: fv!identifier
                )
              }
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Customer Id",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{f701f00d-ee33-4307-8aac-0d6d16c31657}idCustomer',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{f701f00d-ee33-4307-8aac-0d6d16c31657}idCustomer'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Branch Id",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{cca2a98a-8d37-47cf-96ce-32e076077459}idBranch',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{cca2a98a-8d37-47cf-96ce-32e076077459}idBranch'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Deposit Amount",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{bd691a2f-841a-4876-9779-78490577481d}depositAmount',
            value: if(
            isnull(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{bd691a2f-841a-4876-9779-78490577481d}depositAmount']),
            fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{bd691a2f-841a-4876-9779-78490577481d}depositAmount'],
            fixed(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{bd691a2f-841a-4876-9779-78490577481d}depositAmount'], 2)
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Currency Code",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6da19d7c-f1cb-4608-94e7-d0118b8b131f}currencyCode',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6da19d7c-f1cb-4608-94e7-d0118b8b131f}currencyCode'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Multi Balance",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{d396a4c7-7424-4f11-ac5d-565aa6d8ddaf}multiBalance',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{d396a4c7-7424-4f11-ac5d-565aa6d8ddaf}multiBalance'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Interest Acc Type",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{3ad6f1e5-8d62-43dd-bbfc-da1b44d11052}interestAccType',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{3ad6f1e5-8d62-43dd-bbfc-da1b44d11052}interestAccType'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Interest Rate",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{e59bb56b-a1c8-4ba0-8aeb-1b482036308a}interestRate',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{e59bb56b-a1c8-4ba0-8aeb-1b482036308a}interestRate'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Renewal States",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a29cc8cf-975c-4177-b8c5-2802cfcf72ae}renewalStates',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a29cc8cf-975c-4177-b8c5-2802cfcf72ae}renewalStates'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Renewal End Date",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate',
            value: if(
            isnull(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate']),
            fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate'],
            datetext(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate'], "default")
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Deposit Period Type",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4110249f-7152-46d0-af6d-3c30792b7e1c}depositPeriodType',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4110249f-7152-46d0-af6d-3c30792b7e1c}depositPeriodType'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Deposit Days",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a106702b-1902-4da8-a5ed-03d4a523b557}depositDays',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a106702b-1902-4da8-a5ed-03d4a523b557}depositDays'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Number Of Weeks",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{443f765e-2883-47ec-8277-415b799fb8d4}numberOfWeeks',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{443f765e-2883-47ec-8277-415b799fb8d4}numberOfWeeks'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Number Of Months",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{363cbe3c-508b-4f3d-8835-df5ba4c6d436}numberOfMonths',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{363cbe3c-508b-4f3d-8835-df5ba4c6d436}numberOfMonths'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Number Of Years",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{7eac283d-3cd3-4611-9edf-87582eecd374}numberOfYears',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{7eac283d-3cd3-4611-9edf-87582eecd374}numberOfYears'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "To Date",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6a9bbfa5-e819-4364-b8d5-36b6b59b9fc0}toDate',
            value: if(
            isnull(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6a9bbfa5-e819-4364-b8d5-36b6b59b9fc0}toDate']),
            fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6a9bbfa5-e819-4364-b8d5-36b6b59b9fc0}toDate'],
            datetext(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6a9bbfa5-e819-4364-b8d5-36b6b59b9fc0}toDate'], "default")
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New Deposit Period Type",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4bafd1e3-373c-443a-8d43-f1b35d47bc70}newDepositPeriodType',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4bafd1e3-373c-443a-8d43-f1b35d47bc70}newDepositPeriodType'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New Deposit Days",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{fdbdd365-d1f2-4c94-88dc-26b1899c92a6}newDepositDays',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{fdbdd365-d1f2-4c94-88dc-26b1899c92a6}newDepositDays'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New Number Of Weeks",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{c227c224-4e2b-42f4-a8c9-768f18aa20e5}newNumberOfWeeks',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{c227c224-4e2b-42f4-a8c9-768f18aa20e5}newNumberOfWeeks'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New Number Of Months",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{9f170f63-d9f3-49ca-bb1d-5e6af7adf4cd}newNumberOfMonths',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{9f170f63-d9f3-49ca-bb1d-5e6af7adf4cd}newNumberOfMonths'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New Number Of Years",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{90f31a32-f366-4cc9-be81-c7c453d66061}newNumberOfYears',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{90f31a32-f366-4cc9-be81-c7c453d66061}newNumberOfYears'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "New To Date",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{0713d031-d022-49c5-95c5-684c2427b50f}newToDate',
            value: if(
            isnull(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{0713d031-d022-49c5-95c5-684c2427b50f}newToDate']),
            fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{0713d031-d022-49c5-95c5-684c2427b50f}newToDate'],
            datetext(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{0713d031-d022-49c5-95c5-684c2427b50f}newToDate'], "default")
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Added On",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{2f88040c-5df2-453d-b1c9-5bd8e84802c9}addedOn',
            value: if(
            isnull(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{2f88040c-5df2-453d-b1c9-5bd8e84802c9}addedOn']),
            fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{2f88040c-5df2-453d-b1c9-5bd8e84802c9}addedOn'],
            datetext(fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{2f88040c-5df2-453d-b1c9-5bd8e84802c9}addedOn'], "default")
            ),
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Added By",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{1a869463-2038-463b-aa29-c39fa0cd6a52}addedBy',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{1a869463-2038-463b-aa29-c39fa0cd6a52}addedBy'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Updated By",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{b551bf70-3d12-492c-88c8-a58537c57dfe}updatedBy',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{b551bf70-3d12-492c-88c8-a58537c57dfe}updatedBy'],
            align: "CENTER"
          ),
          a!gridColumn(
            label: "Updated On",
            sortField: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{d9c34d44-e287-4060-8e8b-cb993f7975dc}updatedOn',
            value: fv!row['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{d9c34d44-e287-4060-8e8b-cb993f7975dc}updatedOn'],
            align: "CENTER"
          )
        },
        selectable: false,
        validations: {},
        borderStyle: "STANDARD",
        refreshAfter: "RECORD_ACTION",
        showSearchBox: false,
        showRefreshButton: true,
        recordActions: {
          a!recordActionItem(
            action: 'recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.actions.{5c7a858f-8b64-4c5c-b2d3-0afc0c4cc59e}newDeposit'
          )
        }
      )
    }
  )
}

  Discussion posts and replies are publicly visible

Parents
  • and this is the code for the new record 

    a!localVariables(
      local!branchValue,
      local!customerAccount,
      local!customerid,
      /*define the local variable that i want to put in the drop down*/
      local!branchesName:rule!RDA_GetAllBranchName(),
      local!customerdata: rule!RDA_SearchBranchAccount(),
      /*to get the type of period */
      local!depositperiodtype:rule!RDA_GetPeriodAccountType(),
      local!depositperiodtypeNew,
      local!multibalance,
      local!ledgercode,
      local!inseraccount,
      local!renwalstatus,
      local!newdepositperiod,
      local!DebitValueDate,
     
      /*make the local variable for all the field on the deposit Detalis*/
      local!depositday,
      local!numberofweek,
      local!numberofmonth,
      local!numberofyear,
      /*create the local for the deposit amount*/
      local!depositAmount,
      local!ledger:rule!RDA_ToGetLedger(),
      /*to get the value from the query and put it in drop down*/
      local!multiBalancenew:rule!RDA_ToGetMultiBalance(),
      /*to get the rule for the account type*/
      local!accountType:rule!RDA_ToGetAccountType(),
      local!accountTypeNew,
      /*to get the renwal status*/
      local!renwal:rule!RDA_ToGetRenwalStatus(),
      local!renwalNew,
      /* To get the Balncing Period*/
      local!BalancingPeriod:rule!RDA_ToGetBalancingPeriod(),
      local!BalancingPeriodNew,
      
      /*to get the new deposit period type*/
      local!depositperiodtypeanother:rule!RDA_ToGetNewPeriodType(),
      local!depositperiodtypeanothernew,
      
     
     
      local!fortraicreate:false(),
    
    
      
      /*Query to get the customer from the branch and accout*/
      /*if statment to check the query*/ 
      local!customerdatanew:rule!RDA_getCustomerDetailsFromAccountAndBranch(
        branchid:local!branchValue,
        accountnum:  local!customerAccount),
        
      /*call another query to call for the account*/
        
        local!customerAccountDetalis:rule!RDA_toGetAllAccountForCustomer(
        branchid:local!branchValue,
        accountnum:  local!customerAccount),
        
        
      
    
      
     
      local!showboxinfo:true,
      local!noFiltersApplied: all(fn!isnull, {local!branchValue, local!customerAccount}),
      a!formLayout(
        label: "",
        contents: {
          a!sectionLayout(
            label: "New Deposit Request",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!dropdownField(
                        label: "Branches",
                        labelPosition: "ABOVE",
                        placeholder: "--- Select a Value ---",
                        choiceLabels: local!branchesName['recordType!{c5841245-4826-4ef2-a3d8-a5407a445edb}RDA Branch.fields.{5fa864a0-4174-4956-875e-dbffadf0e323}nameInArabic'],
                        choiceValues: local!branchesName['recordType!{c5841245-4826-4ef2-a3d8-a5407a445edb}RDA Branch.fields.{bea07028-4c3d-4879-9f5d-7f425aaef187}idBranch'],
                        /*To save the value to value*/
                        value: local!branchValue,
                        saveInto: {
                          local!branchValue,
                          
                          a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{cca2a98a-8d37-47cf-96ce-32e076077459}idBranch'],local!branchValue),
                          a!save(ri!Branche,local!branchValue)
                        },
                        searchDisplay: "AUTO",
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Customer Account",
                        labelPosition: "ABOVE",
                        /*to save the value in the customer account*/
                        value:local!customerAccount,
                        saveInto:{
                          local!customerAccount,
                          a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{fd8c420d-ca89-4ef3-8269-f871e713b3e4}idAccount'],local!customerAccount),
                          a!save(ri!customer,local!customerAccount)
                          
                          
                          },
                        refreshAfter: "UNFOCUS",
                        required: true,
                        validations: {
                          if (
                            len(tostring(local!customerAccount))=7,
                            null,
                            "The account number must to be 7 numbers"
                          )
                        }
                      )
                    }
                  )
    
    
                },
                marginAbove: "STANDARD",
                marginBelow: "STANDARD",
                stackWhen: {
                  "NEVER"
                },
                showDividers: false
              )
            },
            isCollapsible: false,
            isInitiallyCollapsed: false,
            divider: "ABOVE",
            dividerWeight: "MEDIUM",
            marginAbove: "NONE"
          ),
          a!boxLayout(
            label: "Customer Info",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Name",
                        labelPosition: "ABOVE",
                        value: local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{e25eb830-c2fd-44fb-9114-4d2ee04f92cb}customerName'],
                        saveInto: {local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{e25eb830-c2fd-44fb-9114-4d2ee04f92cb}customerName']},
                        refreshAfter: "UNFOCUS",
                        readOnly: true,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Customer Type",
                        labelPosition: "ABOVE",
                        value: local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{9c3e790e-02c5-4ded-8186-2d6e91ab3421}customerType'],
                        saveInto: {local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{9c3e790e-02c5-4ded-8186-2d6e91ab3421}customerType']},
                        refreshAfter: "UNFOCUS",
                        readOnly: true,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Customer Class",
                        labelPosition: "ABOVE",
                        value: local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{43ed8c48-c895-4af8-b85c-69eebfefb9b8}customerClass'],
                        saveInto: {local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{43ed8c48-c895-4af8-b85c-69eebfefb9b8}customerClass']},
                        refreshAfter: "UNFOCUS",
                        readOnly: true,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "National Id",
                        labelPosition: "ABOVE",
                        value: local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{1d9fd47b-7bcd-4238-8b3f-c015a9ce29d0}nationalId'],
                        saveInto: {local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{1d9fd47b-7bcd-4238-8b3f-c015a9ce29d0}nationalId']},
                        refreshAfter: "UNFOCUS",
                        readOnly: true,
                        validations: {}
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {
                      a!textField(
                        label: "Address",
                        labelPosition: "ABOVE",
                        value: local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{13a9f6f9-192f-4cc1-ae4a-68f48607e76c}customerAddress'],
                        saveInto: {local!customerdatanew['recordType!{d6de57e4-91fc-44f8-8209-13222b53b9b4}RDA Customer.fields.{13a9f6f9-192f-4cc1-ae4a-68f48607e76c}customerAddress']},
                        refreshAfter: "UNFOCUS",
                        readOnly: true,
                        validations: {}
                      )
                    }
                  )
                }
              )
            },
            showWhen: (a!isNotNullOrEmpty(local!customerAccountDetalis)),
            style: "#0000ff",
            marginBelow: "STANDARD"
            
          ),
          a!localVariables(
            local!selection,
            local!selectedAccount,
            {
              /*this section is for the choose debit account*/
           a!sectionLayout(
                label: "Choose Debit Account",
                contents: {
    
                  a!gridField(
                    label: "",
                    labelPosition: "ABOVE",
                    data: rule!RDA_toGetAllAccountForCustomer(
                      accountnum: local!customerAccount,
                      branchid: local!branchValue
                    ),
                    columns: {
                      /*Currency Code*/
                      a!gridColumn(
                        label: "Currency Code",
                        sortField: "currencycode",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.relationships.{5482bf40-6062-4e1c-9d2b-b11ad67a998e}rdaCurrency.fields.{0fe8e240-cc22-4a24-bccc-cec96bf11886}desAr']
                      ),
                      /*Ledger*/
                      a!gridColumn(
                        label: "Ledger",
                        sortField: "ledger",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.relationships.{4f41b3e5-338c-4cc6-9720-a16664f67f1f}rdaLedger.fields.{58cfbfd2-89a5-4a80-9f46-1e72ace876b9}desAr']
                      ),
                      /*ledger Code*/
    
                      a!gridColumn(
                        label: "Ledger Code",
                        sortField: "ledgercode",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{cf750e5c-be43-45fa-b4ca-21d193db4b14}ledgerCode']
                      ),
    
                      /*Sub Account*/
                      a!gridColumn(
                        label: "Sub Account",
                        sortField: "subaccount",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{8877ae39-1845-458f-bb77-f68b9117f843}subAccount']
                      ),
    
                      /*Risk Limit*/
                      a!gridColumn(
                        label: "Risk Limit",
                        sortField: "risklimit",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{161271a2-7e64-4dbe-8458-38217e80106b}riskLimit']
                      ),
    
                      /* Available Balance*/
                      a!gridColumn(
                        label: "Available Balance",
                        sortField: "availablebalance",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{758e56a3-8f73-4f61-bcac-83b70307b98f}avaiableBalance']
                      ),
                      /*Dollar Equivalent*/
                      a!gridColumn(
                        label: "Dollar Equivalent",
                        sortField: "dollarequivalent",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{8f921c0b-188f-4502-b5d8-2040ecbbda5b}dollarEquivalent']
                      ),
                      /*Account Restriction*/
                      a!gridColumn(
                        label: "Account Restriction",
                        sortField: "accountrestriction",
                        value: fv!row['recordType!{47912efb-2bcc-46aa-8bb4-19ed6593ac5b}RDA Account.fields.{8b8b8c85-c7bf-4032-84a2-25fe8a65bccb}amountRestrication']
                      )
    
                    },
                    selectable: true,
                    selectionValue: local!selection,
                    selectionSaveInto: {
                      local!selection,
                      /* This save adds the full rows of data for items selected in the most recent user interaction to local!selectedEmployees. */
                      a!save(local!selectedAccount, append(local!selectedAccount, fv!selectedRows)),
                      /* This save removes the full rows of data for items deselected in the most recent user interaction to local!selectedEmployees. */
                      a!save(local!selectedAccount, difference(local!selectedAccount, fv!deselectedRows))
                    },
                    validations: {}
                  )
    
    
                },
                showWhen:and(
                  a!isNotNullOrEmpty(local!customerAccountDetalis),
                  or(isnull(local!selectedAccount), length(local!selectedAccount) = 0))
    
    
              ),
              /*this section is for the create new deposit*/
          a!sectionLayout(
            label: "",
            contents: {
              a!sectionLayout(
                label: "Create Deposit",
                contents: {
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Debit Account",
                            labelPosition: "ABOVE",
                            /*to get the id for the account*/
                            value: index(local!selectedAccount,1,"null").idAccount,
                            saveInto: {index(local!selectedAccount,1,"null").idAccount},
                            refreshAfter: "UNFOCUS",
                            readOnly: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {}
                      ),
                      a!columnLayout(
                        contents: {}
                      )
                    }
                  )
                }
              ),
              a!localVariables(
                local!indexArray:index(local!selectedAccount,1,"null"),
              a!boxLayout(
                label: "Deposit Details",
                contents: {
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Deposit Amount",
                            labelPosition: "ABOVE",
                            value:local!depositAmount,
                            
                            saveInto: {local!depositAmount,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{bd691a2f-841a-4876-9779-78490577481d}depositAmount'],local!depositAmount)},
                            refreshAfter: "UNFOCUS",
                            required: true,
                            validations: {if (
                              and(a!isNotNullOrEmpty(local!depositAmount),local!depositAmount<=local!indexArray.avaiableBalance),
                              null(),"Deposit Amount can't be larger than avaiable Balance")}
                          )
                        }
                      ),
                      /*put the local variable*/
                      a!localVariables(
                        local!currencyname:rule!RDA_toGetCurrenyToGrid(
                          idcurrency: local!indexArray.currencyCode
                        ),
                        a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Currency Code",
                            labelPosition: "ABOVE",
                            value: {local!currencyname['recordType!{5e9af92e-b260-4c13-96d7-220c915dbdf0}RDA Currency.fields.{0fe8e240-cc22-4a24-bccc-cec96bf11886}desAr']},
    
    
    
                            saveInto: {local!currencyname['recordType!{5e9af92e-b260-4c13-96d7-220c915dbdf0}RDA Currency.fields.{0fe8e240-cc22-4a24-bccc-cec96bf11886}desAr'],
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{6da19d7c-f1cb-4608-94e7-d0118b8b131f}currencyCode'],local!currencyname['recordType!{5e9af92e-b260-4c13-96d7-220c915dbdf0}RDA Currency.fields.{0efd6fec-d5be-4b2c-b3b6-5f98997494a3}idCurrency'])},
                            refreshAfter: "UNFOCUS",
                            required: true,
                            readOnly: false,
                            disabled: true,
                            validations: {}
                          )
                        }
                      )),
                        
                     
                      
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Ledger Code",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels: local!ledger['recordType!{5929b5c3-a8c4-484b-8696-e9faf41672c2}RDA Ledger.fields.{58cfbfd2-89a5-4a80-9f46-1e72ace876b9}desAr'],
                            choiceValues: local!ledger['recordType!{5929b5c3-a8c4-484b-8696-e9faf41672c2}RDA Ledger.fields.{fdfe8b26-5460-411d-8ae4-d424d2b35394}idLedger'],
                            value:  local!ledgercode,
                            saveInto: {local!ledgercode,
                           
                            /*Note i must add the record to deposit field*/
                            /*a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit'.],local!ledger['recordType!{5929b5c3-a8c4-484b-8696-e9faf41672c2}RDA Ledger.fields.{fdfe8b26-5460-411d-8ae4-d424d2b35394}idLedger']*/
                            },
                            searchDisplay: "AUTO",
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Multi Balance",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels:local!multiBalancenew['recordType!{35a006ad-f483-48bd-80b6-c1b13b2c47ba}RDA MultiBalance.fields.{82fd9ea7-64aa-48de-ba1a-851a614a1225}desAr'],
                            choiceValues:local!multiBalancenew['recordType!{35a006ad-f483-48bd-80b6-c1b13b2c47ba}RDA MultiBalance.fields.{0d72a1bb-566f-4d09-95da-532bd8fb0508}idMulti'],
                            value:local!multibalance,
                            saveInto: {local!multibalance,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{d396a4c7-7424-4f11-ac5d-565aa6d8ddaf}multiBalance'],local!multibalance)},
                            searchDisplay: "AUTO",
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Balancing Period",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels: local!BalancingPeriod['recordType!{938dd1e7-6927-40e5-b533-4e0bc681d0d8}RDA BalancingPeriod.fields.{d5125e1d-123a-40c4-ac71-69aac9b14171}desAr'],
                            choiceValues: local!BalancingPeriod['recordType!{938dd1e7-6927-40e5-b533-4e0bc681d0d8}RDA BalancingPeriod.fields.{d50a0cd9-e01e-4b71-a73d-ad1080b4fb24}idBalance'],
                            value: local!BalancingPeriodNew,
                            /*saveInto: {local!BalancingPeriodNew,a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit'.])},*/
                            searchDisplay: "AUTO",
                            showWhen: if (and(a!isNotNullOrEmpty(local!multiBalance),local!multibalance=1),true(),false()),
                            required: true,
                            validations: {}
                          )
                        }
                      )
                    }
                  ),
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Interest Acc. Type",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels: local!accountType['recordType!{3d0d8567-be8e-4c60-b4da-442d4f41a9e5}RDA AccountType.fields.{2a8b50f1-47ad-4fff-b8ee-48490a19d1b3}desAr'],
                            choiceValues:local!accountType['recordType!{3d0d8567-be8e-4c60-b4da-442d4f41a9e5}RDA AccountType.fields.{2d55516f-64ff-44b0-951c-a1af993429bf}idType'],
                            value:local!accountTypeNew,
                            saveInto: {local!accountTypeNew,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{3ad6f1e5-8d62-43dd-bbfc-da1b44d11052}interestAccType'],local!accountTypeNew)},
                            searchDisplay: "AUTO",
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dateField(
                            label: "Debit Value Date",
                            labelPosition: "ABOVE",
                            value: local!DebitValueDate,
                            saveInto: {local!DebitValueDate
                           },
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dateField(
                            label: "Credit Value Date",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Interest Rate",
                            labelPosition: "ABOVE",
                            value:ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{e59bb56b-a1c8-4ba0-8aeb-1b482036308a}interestRate'],
                            saveInto: {ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{e59bb56b-a1c8-4ba0-8aeb-1b482036308a}interestRate']},
                            refreshAfter: "UNFOCUS",
                            required: true,
                            disabled: false,
                            masked: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Renewal States",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels:local!renwal['recordType!{c0d08a29-b611-4b18-ac15-87ab629405b1}RDA RenwalStatus.fields.{b56ad68c-ba47-4501-813e-ac7f71fb58b2}desAr'],
                            choiceValues:local!renwal['recordType!{c0d08a29-b611-4b18-ac15-87ab629405b1}RDA RenwalStatus.fields.{d721a2a7-64b8-4272-89e7-a9b3bd2acaca}idRenwal'],
                            value:local!renwalNew,
                            saveInto: {local!renwalNew,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a29cc8cf-975c-4177-b8c5-2802cfcf72ae}renewalStates'],local!renwalNew)},
                            searchDisplay: "AUTO",
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dateField(
                            label: "Renewal End Date",
                            labelPosition: "ABOVE",
                            value: ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate'],
                            saveInto: {ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{46941675-d8bb-4e8f-9ccd-df20ddd039f3}renewalEndDate']},
                            disabled: a!match(
                              value: local!renwalNew,
                              equals: 1,
                              then: {true()},
                              equals:2 ,
                              then: {false()},
                              equals:3,
                              then: {false()},
                              equals: null,
                              then: {false()},
                              default: {false()}
                              
                            ),
                           
                            validations: {}
                          )
                        }
                      )
                    }
                  ),
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "Deposit Period Type",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels: local!depositperiodtype['recordType!{7d2e1940-011b-44e9-a362-e365c9aaa76b}RDA DepositPeriodType.fields.{d507b859-5ec9-4aa8-a710-f40cdccd3217}desAr'],
                            choiceValues: local!depositperiodtype['recordType!{7d2e1940-011b-44e9-a362-e365c9aaa76b}RDA DepositPeriodType.fields.{b5d1dcf1-6c37-436e-b15a-dd4a56aa117b}idPeriod'],
                            value:local!depositperiodtypeNew,
                            saveInto: {local!depositperiodtypeNew,a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4110249f-7152-46d0-af6d-3c30792b7e1c}depositPeriodType'],local!depositperiodtype['recordType!{7d2e1940-011b-44e9-a362-e365c9aaa76b}RDA DepositPeriodType.fields.{b5d1dcf1-6c37-436e-b15a-dd4a56aa117b}idPeriod'])},
                            searchDisplay: "AUTO",
                            required: true,
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Deposit Days",
                            labelPosition: "ABOVE",
                            value: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {local!depositday},
                              /*we must take the local varaible of the weeks and calculate*/
                              equals: 2,
                              then: {if(a!isNotNullOrEmpty(local!numberofweek),local!numberofweek*7,{})},
                              equals: 3,
                              then: {if (a!isNotNullOrEmpty(local!numberofmonth),local!numberofmonth*30,{})},
                              equals: 4,
                              then: {if (a!isNotNullOrEmpty(local!numberofyear),local!numberofyear*356,{})},
                              equals: null,
                              then: {null()},
                              default: {null()}
    
                            ),
                     
                            saveInto: {local!depositday,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{a106702b-1902-4da8-a5ed-03d4a523b557}depositDays'],local!depositday)
                           
                            },
                            refreshAfter: "UNFOCUS",
                            required: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {true()},
                              equals: 2,
                              then: {false()},
                              equals: 3,
                              then: {false()},
                              equals: 4,
                              then: {false()},
                              equals: null,
                              then: {false()},
                              default: {false()}
    
    
                            ),
                            readOnly: false,
                            disabled: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {false()},
                              equals: 2,
                              then: {true()},
                              equals: 3,
                              then: {true()},
                              equals: 4,
                              then: {true()},
                              equals: null,
                              then: {false()},
                              default: {false()}
                            
                            
                            ),
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Number of Weeks",
                            labelPosition: "ABOVE",
                            value:a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {if (a!isNotNullOrEmpty(local!depositday),local!depositday/7,{})},
                              /*we must take the local varaible of the weeks and calculate*/
                              equals: 2,
                              then: {local!numberofweek},
                              equals: 3,
                              then: {if(a!isNotNullOrEmpty(local!numberofmonth),local!numberofmonth/4,{})},
                              equals: 4,
                              then: {if(a!isNotNullOrEmpty(local!numberofyear),local!numberofyear/52,{})},
                              equals: null,
                              then: {null()},
                              default: {null()}
    
                            ),            /*there is an error if not handel that */ 
                            saveInto: {local!numberofweek,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{443f765e-2883-47ec-8277-415b799fb8d4}numberOfWeeks'],local!numberofweek)},
                            refreshAfter: "UNFOCUS",
                            
                            required:  a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {false()},
                              equals: 2,
                              then: {true()},
                              equals: 3,
                              then: {false()},
                              equals: 4,
                              then: {false()},
                              equals: null,
                              then: {false()},
                              default: {false()}
    
    
                            ),
                            disabled: 
                            /**/
                            a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {true()},
                              equals: 2,
                              then: {false()},
                              equals: 3,
                              then: {true()},
                              equals: 4,
                              then: {true()},
                              equals: null,
                              then: {false()},
                              default: {false()}
                            ),
                            masked: false,
                            
                            
                            /**/
                            validations: {
                              null
                            }
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Number of Months",
                            labelPosition: "ABOVE",
                            value: /**/
                            a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {if (a!isNotNullOrEmpty(local!depositday),local!depositday/30,{})},
                              /*we must take the local varaible of the weeks and calculate*/
                              equals: 2,
                              then: {if (a!isNotNullOrEmpty(local!numberofweek),local!numberofweek/4,{})},
                              equals: 3,
                              then: {local!numberofmonth},
                              equals: 4,
                              then: {if(a!isNotNullOrEmpty(local!numberofyear),local!numberofyear*12,{})},
                              equals: null,
                              then: {null()},
                              default: {null()}
    
                            ),
    
                            /**/
                            saveInto: {local!numberofmonth,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{363cbe3c-508b-4f3d-8835-df5ba4c6d436}numberOfMonths'],local!numberofmonth)},
                            refreshAfter: "UNFOCUS", 
                            
                            required:  a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {false()},
                              equals: 2,
                              then: {false()},
                              equals: 3,
                              then: {true()},
                              equals: 4,
                              then: {false()},
                              equals: null,
                              then: {false()},
                              default: {false()}
    
    
                            ),
                            /**/
                            disabled: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {true()},
                              equals: 2,
                              then: {true()},
                              equals: 3,
                              then: {false()},
                              equals: 4,
                              then: {true()},
                              equals: null,
                              then: {false()},
                              default: {false()}
                              ),
                            
                            
                            /**/
                            
                            
                            
                            
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "Number of Years",
                            labelPosition: "ABOVE",
                            /*the value is*/
                            value: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {if(a!isNotNullOrEmpty(local!depositday),local!depositday/356,{})},
                              /*we must take the local varaible of the weeks and calculate*/
                              equals: 2,
                              then: {if (a!isNotNullOrEmpty(local!numberofweek),local!numberofweek/52,{})},
                              equals: 3,
                              then: {if (a!isNotNullOrEmpty(local!numberofmonth),local!numberofmonth/12,{})},
                              equals: 4,
                              then: {local!numberofyear},
                              equals: null,
                              then: {null()},
                              default: {null()}
    
                            ),
                
                            saveInto: {local!numberofyear,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{7eac283d-3cd3-4611-9edf-87582eecd374}numberOfYears'],local!numberofyear)},
                            refreshAfter: "UNFOCUS",
                            
                            required:  a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {false()},
                              equals: 2,
                              then: {false()},
                              equals: 3,
                              then: {false()},
                              equals: 4,
                              then: {true()},
                              equals: null,
                              then: {false()},
                              default: {false()}
    
    
                            ),
                            
                            /**/
                            disabled: a!match(
                              value:local!depositperiodtypeNew,
                              equals: 1,
                              then: {true()},
                              equals: 2,
                              then: {true()},
                              equals: 3,
                              then: {true()},
                              equals: 4,
                              then: {false()},
                              equals: null,
                              then: {false()},
                              default: {false()}
                            ),
                            
                            /**/
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dateField(
                            label: "To Date",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            validations: {}
                          )
                        }
                      )
                    }
                  ),
                  a!columnsLayout(
                    columns: {
                      a!columnLayout(
                        contents: {
                          a!dropdownField(
                            label: "New Deposit Period Type",
                            labelPosition: "ABOVE",
                            placeholder: "--- Select a Value ---",
                            choiceLabels: local!depositperiodtypeanother['recordType!{9a877083-7599-4e2b-88c7-819dcf14ff35}RDA NewPeriodTypeAccount.fields.{de07381f-b7e4-4a33-a3d3-1fd53b8f4e36}desAr'],
                            choiceValues: local!depositperiodtypeanother['recordType!{9a877083-7599-4e2b-88c7-819dcf14ff35}RDA NewPeriodTypeAccount.fields.{e7378ab6-b3c5-4594-9c44-d25fac7c4d1e}idNewperiod'],
                            value:local!depositperiodtypeanothernew,
                            saveInto: {local!depositperiodtypeanothernew,
                            a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.fields.{4bafd1e3-373c-443a-8d43-f1b35d47bc70}newDepositPeriodType'],local!depositperiodtypeanothernew)},
                            searchDisplay: "AUTO",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "New Deposit Days",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            refreshAfter: "UNFOCUS",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "New Number of Weeks",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            refreshAfter: "UNFOCUS",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "New Number of Months",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            refreshAfter: "UNFOCUS",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!textField(
                            label: "New Number of Years",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            refreshAfter: "UNFOCUS",
                            validations: {}
                          )
                        }
                      ),
                      a!columnLayout(
                        contents: {
                          a!dateField(
                            label: "To Date",
                            labelPosition: "ABOVE",
                            saveInto: {},
                            validations: {}
                          )
                        }
                      )
                    }
                  )
                },
                style: "#0000ff",
                isCollapsible: false,
                marginBelow: "STANDARD"
              )),
              a!localVariables(
                local!dataGridEdit,
                a!boxLayout(
                label: "Document Details",
                contents: {
                  a!localVariables(
                    /*  
      * local!employees is provided in this recipe as a way to start with hard-coded
      * data. However, this data is identical to the data created from the entity-backed
      * tutorial. Replace the hard-coded data with a query to the employee data store
      * entity and all of the employee records from the tutorial will appear.
      *
      * To replace this data with your own, replace (ctrl+H or cmd+H) all references to
      * local!employees with your data source, either via rule input or local variable.
      */
    
                    local!originalString: tostring(loggedInUser()), 
                    local!dotCharacter: ".",
                    local!spaceCharacter: " ",
                    /* sojood barham@experts ps */
                    local!addedBy2: substitute(local!originalString, local!dotCharacter, local!spaceCharacter),
                    local!dotCharacter2: " barham@experts ps",
                    local!spaceCharacter2: "",
                    local!addedBy: substitute(local!addedBy2, local!dotCharacter2, local!spaceCharacter2),
    
    
                    local!employees,
                    local!document,
                    local!classification,
                    a!formLayout(
                     
                      contents: {
                        a!gridLayout(
                          totalCount: count(local!employees),
                          headerCells: {
                            a!gridLayoutHeaderCell(label: "Upload Document" ),
                            a!gridLayoutHeaderCell(label: "Name" ),
                            a!gridLayoutHeaderCell(label: "Clasification" ),
                            a!gridLayoutHeaderCell(label: "Updated By" ),
                            a!gridLayoutHeaderCell(label: "Updated On" ),
    
                            /* For the "Remove" column */
                            a!gridLayoutHeaderCell(label: "" )
                          },
                          /* Only needed when some columns need to be narrow */
                          columnConfigs: {
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
                            a!gridLayoutColumnConfig(width: "DISTRIBUTE", weight:3 ),
    
                            a!gridLayoutColumnConfig(width: "ICON")
                          },
                          /*
            * a!forEach() will take local!employee data and used that data to loop through an
            * expression that creates each row.
            *
            * When modifying the recipe to work with your data, you only need to change:
            * 1.) the number of fields in each row
            * 2.) the types of fields for each column (i.e. a!textField() for text data elements)
            * 3.) the fv!item elements. For example fv!item.firstName would change to fv!item.yourdata
            */
                          rows: a!forEach(
                            items: local!employees,
                            expression: a!gridRowLayout(
                              id: fv!index,
                              contents: {
                                /* For the First Name Column*/
                                a!fileUploadField(
                                  label: "File Upload",
                                  labelPosition: "ABOVE",
                                  target: cons!RDA_DOCUMENT,
                                  maxSelections: 1,
                                  value: local!document,
                                  saveInto: {local!document,
                                  a!save(ri!record['recordType!{df6fbb1a-9532-49a0-a8bd-61c6440eb962}RDA Deposit.relationships.{bffc709b-0c45-42a1-a708-dd4abeef7278}rdaAttachment.fields.{cd4332dd-d46d-4fe7-b08a-3b117d5fc038}idAppianAttachment'],local!document)
                                  },
                                  validations: {}
                                ),
                                /* For the Last Name Column*/
                                a!textField(
                                  label: "last name " & fv!index,
                                  value:{index(local!document,1,"null")},
                                  saveInto: fv!item.lastName,
                                  required:true
                                ),
                                /* For the Department Column*/
                                a!dropdownField(
                                  label: "department " & fv!index,
                                  placeholder: "-- Select -- ",
                                  choiceLabels: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                                  choiceValues: { "Corporate", "Engineering", "Finance", "Human Resources", "Professional Services", "Sales" },
                                  value: local!classification,
                                  saveInto: local!classification,
                                  required:true
                                ),
                                /* For the Updated By Column*/
                                a!textField(
                                  label: "title " & fv!index,
                                  value: local!addedBy,
                                  saveInto: fv!item.title,
                                  required:true
                                ),
                                /* For the Updated on Column*/
                                a!textField(
                                  label: "phone number " & fv!index,
                                  placeholder:"555-456-7890",
                                  value: fv!item.phoneNumber,
                                  saveInto: fv!item.phoneNumber,
                                  validations: if( len(fv!item.phoneNumber) > 12, "Contains more than 12 characters. Please reenter phone number, and include only numbers and dashes", null )
                                ),
    
                                /* For the Removal Column*/
                                a!richTextDisplayField(               
                                  value: a!richTextIcon(
                                    icon: "close",
                                    altText: "delete " & fv!index,
                                    caption: "Remove " & fv!item.firstName & " " & fv!item.lastName,
                                    link: a!dynamicLink(
                                      value: fv!index,
                                      saveInto: {
                                        a!save(local!employees, remove(local!employees, save!value))
                                      }
                                    ),
                                    linkStyle: "STANDALONE",
                                    color: "NEGATIVE"
                                  )
                                )
                              }
                            )
                          ),
                          addRowlink: a!dynamicLink(
                            label: "Add Document",
                            /*
               * For your use case, set the value to a blank instance of your CDT using
               * the type constructor, e.g. type!Employee(). Only specify the field
               * if you want to give it a default value e.g. startDate: today()+1.
               */
                            value: {startDate: today() + 1},
                            saveInto: {
                              a!save(local!employees, append(local!employees, save!value))
                            }
                          ),
                          /* This validation prevents existing employee start date from changing to a date in the future*/
                          validations: if(
                            a!forEach(
                              items: local!employees,
                              expression: and( not( isnull( fv!item.id)), todate(fv!item.startDate) > today() )
                            ),
                            "Existing Employees cannot have an effective start date beyond today",
                            null
                          ),
                          rowHeader: 1
                        )
                      
                      }
                      /*buttons: a!buttonLayout(*/
                        /*primaryButtons: a!buttonWidget(*/
                          /*label: "Submit",*/
                          /*submit: true*/
                        /*)*/
                      /*)*/
                    )
                  )
    
                },
                style: "#0000ff",
                marginBelow: "STANDARD"
              )
              )
              
            },
            showWhen: or(a!isNotNullOrEmpty(local!selectedAccount))
              
          )
    
          /* this section is for the selestion grid so i want to do it */
          /* i want tp put the local variable to view between grid then the depoit request */
        
         
          }
          ),
          a!sectionLayout(
            label: "",
            contents: {
              a!columnsLayout(
                columns: {
                  a!columnLayout(
                    contents: {
                      a!buttonArrayLayout(
                        buttons: {
                          a!buttonWidget(
                            label: "Cancel",
                            style: "NORMAL"
                          )
                        },
                        align: "START"
                      )
                    }
                  ),
                  a!columnLayout(
                    contents: {}
                  ),
                  a!columnLayout(
                    contents: {
                      a!buttonArrayLayout(
                        buttons: {
                          a!buttonWidget(
                            label:if (ri!isUpdate,"Save","Create"),
                            submit: true,
                            style: "PRIMARY",
                          )
                        },
                        align: "END"
                      )
                    }
                  )
                }
              )
            }
          )
          
          
          
          
    
        }
    /*for all the form*/
      )
      /*for the local varaible */
    )
    

  • 0
    Certified Lead Developer
    in reply to Jimy3751

    Please check if your rule input of this process start form is mapped to process variable in process properties of your process model. If they are mapped correctly, you should be able to insert the values in database using write record in your process model and see your grid with refreshed values.

Reply Children
No Data