Showing posts with label Power platform. Show all posts
Showing posts with label Power platform. Show all posts

Thursday, March 12, 2020

Create new line in powerapps

Below command will help to feed newline in power apps.

Char(13) & Char(10)

Place label control in Power apps screen, In Text property write the below command

"-You are not allowed to buy that much stuff" & char(13) & char(10) &
"-Insufficient funds"

The above text will be displayed in two lines.


Wednesday, March 11, 2020

D365FO Number sequence in powerapps

In below example, i used to fetch next purchase order number from D365FO.

This is not an actual program, just for an entity reference details.

Set(GlbNumberSequenceFormat, LookUp(SequenceTables,NumberSequenceCode="Purc_162",Format));
Set(GlbNextNumber, LookUp(SequenceTables,NumberSequenceCode="Purc_162",Next));
Set(GlbNextPurchaseOrderNumber,Replace(GlbNumberSequenceFormat,6,6,Text(GlbNextNumber,"000000")));

Tuesday, March 10, 2020

Errorkind enum values in powerapps

Hi all,

Errors function will return 4 values.

  1. Record - It will return the error record details. For new record creation the field will be empty
  2. Column - It will return the error column details, If there is no error in
  3. Message - It will return actual error message to display user
  4. Error - It will return error code. Using Error codes we can handle the errors.

Microsoft provided list of errors returned by Errors() function in powerapps. I have added the Error kind enum values. 

ErrorCode
ErrorKind
Description
0
ErrorKind.None
There is no error.
1
ErrorKind.Sync
Database synchronization error. An error was reported by the data source. Check the Message column for more information.
2
ErrorKind.MissingRequired
Mandatory field value is missing
3
ErrorKind.CreatePermission
Current user doesn't have permission to create records.
4
ErrorKind.EditPermission
Current user doesn't have permission to edit records.
5
ErrorKind.DeletePermission
Current user doesn't have permission to delete records.
6
ErrorKind.Conflict
Update conflict error. Another change was made to the same record, resulting in a change conflict. Use the Refresh function to reload the record and try the change again.
7
ErrorKind.NotFound
Record not found while updating / editing the record.
8
ErrorKind.ConstraintViolation
Primary key validation. One or more constraints have been violated.
9
ErrorKind.GeneratedValue
Trying to update system fields like createdOn, CreatedDateTime, ModifiedOn, ModifiedDateTime.
(data source generates automatically).
10
ErrorKind.ReadOnlyValue
Trying to update read only fields
11
ErrorKind.Validation
There was a general validation issue detected, that did not fit one of the other kinds.
12
ErrorKind.Unknown
There was an error, but of an unknown kind.

Need to use Validate and DataSourceInfo methods to minimize number of errors while creating or updating the record.


Monday, March 9, 2020

How to pass argument from one canvas app to another canvas app in power apps

Write below code in button onselect method.

Launch("https://web.powerapps.com/apps/<yourAppGUID>?DataElement=" & Text(TextInput1.text))

yourAppGUID = Select your canvas app -> Details -> App id

In target App, get the value using Param function
Set(PassedDataElement,Param("DataElement"))

Open another Canvas app from button click

Below code will help to navigate from one canvas app to another canvas app.

Update Powerapp Guid and tenant Guid
PowerApp guid -> Select the Canvas app -> Details -> App id
Tenant Guid -> Select the Canvas app -> Details -> weblink - End of the weblink you can see the tenant id.
You can also find the tenant id in Azure active directory.


Launch("/providers/Microsoft.PowerApps/apps/[powerappGuid]","tenantId","[tenantguid])

Wednesday, January 22, 2020

Filter, Search, and LookUp functions in Power Apps

Lookup
The LookUp function finds the first record in a table that satisfies a formula. Use LookUp to find a single record that matches one or more criteria.
If no record found, it will return Blank
LookUpTableFormula [, ReductionFormula ] )

ReductionFormula  = return value formula, it is optional parameter, if the value is not passed the entire record will be returned


Filter
The Filter function is used to find records in a table that meet formula criteria.
If no record found, it will return empty table
FilterTableFormula1 [, Formula2, ... ] )

Search
The Search function is different from Filter in that you are finding records that contain a string.
If no record found, it will return empty table.
SearchTableSearchStringColumn1 [, Column2, ... ] )