go to post Robert Cemper · May 6, 2022 therefore I asked for a FULL class definition for BOOK!But I got just 1 line.there can't be help without sufficient information
go to post Robert Cemper · May 6, 2022 Now, this gets clear.With the keyword IDKEY you replaced the default ID naming it RowID. To store it: set book=##class(BOOK).%New() set book.RowId=obj.ID ; from JSON obj set book.Title=obj.Title ; from JSON obj do book.%Save() to retrieve an existing Rowid: set book=##class(BOOK).%OpenId(obj.ID) ;from JSON obj ,;; access or change your book.Title
go to post Robert Cemper · May 5, 2022 I'm sorry. it seems you don't understand what I'm talking about.You just gave me the names. Not the structure and definition. Expected example: Class RestApi.Books Extends %Persistent { Property Title As %String; Property Pages As %Integer; Storage Default { <Data name="BooksDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>Title</Value> </Value> <Value name="3"> <Value>Pages</Value> </Value> </Data> <DataLocation>^RestApi.BooksD</DataLocation> <DefaultData>BooksDefaultData</DefaultData> <IdLocation>^RestApi.BooksD</IdLocation> <IndexLocation>^RestApi.BooksI</IndexLocation> <StreamLocation>^RestApi.BooksS</StreamLocation> } } Class RestApi.Title Extends %Persistent { Property Title As Books; Property Text As %String; Storage Default { <Data name="TitleDefaultData"> <Value name="1"> <Value>%%CLASSNAME</Value> </Value> <Value name="2"> <Value>Title</Value> </Value> <Value name="3"> <Value>Text</Value> </Value> </Data> <DataLocation>^RestApi.TitleD</DataLocation> <DefaultData>TitleDefaultData</DefaultData> <IdLocation>^RestApi.TitleD</IdLocation> <IndexLocation>^RestApi.TitleI</IndexLocation> <StreamLocation>^RestApi.TitleS</StreamLocation> } } it's midnight now. I finish maybe next week.
go to post Robert Cemper · May 5, 2022 the story is clear. Your class definition is not.once more pls show class definitions for RESTAPI.TITLE and ??.BOOK (every class has also a package, default is User) you may need Studio od VSCode to see it. and {"ID":17, "Title":"LEARNING CAHE REST API"} is aDynamic JSON object unrelated to any class definition
go to post Robert Cemper · May 5, 2022 This returns to what we were talking about yesterday. You mix classes with JSON objects and RowID might be something different.so pls add the definition of the classes you talk about (e.g: RESTAPI.TITLE and TITLE table ??)it's not obvious what you refer to in "object without ID but having RowID" ??? How did you get the screenshot?
go to post Robert Cemper · May 5, 2022 Assuming your RowId is unique you can define a unique Index on it. Index RowIdx On RowId [ Type = index, Unique ]; now (after building that index) you can open your object by its RowID SET task.Title = ##class(RESTAPI.TITLE).RowIdxOpen(RowID)
go to post Robert Cemper · May 5, 2022 Every Database in Caché or IRIS has a "NickName" (TEST, APP, USER, *TEMP, ..)The file location is just a pointer related to the location of the file usedSimilar Resource is an attribute to this "NickName". and NOT to the related fileChanging it affects user access, but doesn't care at all about the file location.The *.DAT file has no information about Resources or its NickName. Way back in the past, when file sizes were limited by file systems, there were"Continuation" Files for Cache.DAT. Those knew the starting Cache.DAT.But this is decades back and gone and doesn't exist anymore.
go to post Robert Cemper · May 5, 2022 To find this quoting in Windows kept me busy for quite a while 2 months agoas it wasn't part of the README.md ! GRAND MERCI !
go to post Robert Cemper · May 3, 2022 so your obj is a DynamicObject and looks something like { "ID":17, "Title": 44 } class All.Allbooks has this Property Title As User.Book. To set it you need an oref !! therefore to create the required oref : SET task.Title = ##class(User.Book).%OpenId(obj.Title)
go to post Robert Cemper · May 3, 2022 I will not be present, but my main interest is and ever wasDistributed Code and Version Management in a World Wide Scope I experienced it in personal practice and was always impressed how well that worked.
go to post Robert Cemper · May 3, 2022 You depend on the structure of the dynamic object you compose in the 1st line.if it has a property TitleID it will work. (using obj.TitleID lower case!!) But in your question, it is not clear what Title Class refers to.I see All.Allbooks and somewhere User.Book and also %request and no other class around
go to post Robert Cemper · May 2, 2022 I guess you look for this: ClassMethod GetABookById(id As %Integer) As %Status { SET MyBooks = ##class(All.Allbooks).%OpenId(id) SET obj={} set obj.ID=MyBooks.%Id() set obj.Title=MyBooks.Title WRITE obj.%ToJSON() Quit 1 } ATTENTION:MyBooks.Title is just a reference to User.Book
go to post Robert Cemper · Apr 28, 2022 For some of them exist even concrete proposals for solutions. (e.g. Global <-> JSON)
go to post Robert Cemper · Apr 26, 2022 namespace %SYS ?all required privileges ? Checked Class Docu for 2017.1 >>> query Detail exists ! https://cedocs.intersystems.com/ens20171/csp/documatic/%25CSP.Documatic.cls
go to post Robert Cemper · Apr 26, 2022 this worked for me select CAST(0+AVG(PackingTimeSpent) as TIME) average .... the 0+ forces Integer, then CAST understands youand pls. don't ask why. I just tried the output from AVG() is definitely NOT Integer
go to post Robert Cemper · Apr 25, 2022 this are not properties but an ERROR Status Object.the boxes are non-printable binary values from $LB() or similar.
go to post Robert Cemper · Apr 21, 2022 if this is inside a method add [ProcedureBlock = 0] to the method