BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
EyalGonen
Lapis Lazuli | Level 10

Hi experts,

 

I am developing a SAS Visual Investigator custom page extension and I am using the SVI API documented at:

 
It seems like this API allows access to data presented on the page (correct me if I am wrong) but it does not work for all types of components. For example, it seems to work with Child-Object Viewer component but not with Related Object component (I get a Javascript exception saying no data is available) even though both components are displayed on the same entity page. 
 
1. Is my understanding of what PageModel.data does correct?
2. If it is correct, then shouldn't I be able to reach the underlying data of all objects on the page regardless of their component type?
 
1 ACCEPTED SOLUTION

Accepted Solutions
EwanSkene
SAS Employee

Hi @EyalGonen 

 

The pageModel.data contains:

  • The data for fields of the primary object which are present on the page.
  • The child objects which are present on the page.

These are retrieved as part of the object page request and are used when saving an object - child objects are saved alongside their parent.

 

Other related-object data is not stored in pageModel.data, but can be fetched separately.

e.g.

check traversal UUID with: 

https://developer.sas.com/sdk/vi/apiDocs/interfaces/traversal.TraversalApi.html#getTraversals

and then fetch records with:

https://developer.sas.com/sdk/vi/apiDocs/interfaces/traversal.TraversalApi.html#getFieldsByTraversal...

View solution in original post

3 REPLIES 3
EwanSkene
SAS Employee

Hi @EyalGonen 

 

The pageModel.data contains:

  • The data for fields of the primary object which are present on the page.
  • The child objects which are present on the page.

These are retrieved as part of the object page request and are used when saving an object - child objects are saved alongside their parent.

 

Other related-object data is not stored in pageModel.data, but can be fetched separately.

e.g.

check traversal UUID with: 

https://developer.sas.com/sdk/vi/apiDocs/interfaces/traversal.TraversalApi.html#getTraversals

and then fetch records with:

https://developer.sas.com/sdk/vi/apiDocs/interfaces/traversal.TraversalApi.html#getFieldsByTraversal...

EyalGonen
Lapis Lazuli | Level 10

Hi @EwanSkene 

 

Thanks for replying.

 

1. So I understand there is no single API which generally allows access to all data displayed on the entity page regardless of the component type?

 

2. Let's say I am opening a page for entity type PERSON with ID=11111. I need to access these two values ("PERSON" and "11111") for calling the function you recommended: https://developer.sas.com/sdk/vi/apiDocs/interfaces/traversal.TraversalApi.html#getFieldsByTraversal... how can I obtain these values?

EwanSkene
SAS Employee

1. That's right.
I don't know your use case, but would document generation help here to gather/display object and related data?: https://go.documentation.sas.com/doc/en/vicdc/v_037/visgatorag/custom-document-templates.htm  

2. The pageModel.type and pageModel.id correspond to these values.
You'll also need field names which can be specified, or could take all names from the related object type's metadata fields:
https://developer.sas.com/sdk/vi/apiDocs/interfaces/metadata.MetadataApi.html#getEntity